package com.lei.mvp_retrofitlibrary.mvp.view;

import android.os.Bundle;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

import com.lei.mvp_retrofitlibrary.mvp.presenter.IPresenter;

/**
 * @ProjectName : YoHuo001Java
 * @Author : 雷金泷
 * @Time : 2020/12/13 19:06
 * @Description : 文件描述
 */
public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivity implements IActivty {

    protected P mPrensenter;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(bindlayout());
        initView();
        initData();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        if (mPrensenter!=null){
            mPrensenter.destroy();
            mPrensenter=null;
        }
    }
}
